package homework;


import java.util.Arrays;
import java.util.List;

public class ArrayToList {
    public static void main(String[] args) {

        String[] arr={"one","two","three","four","five"};
        System.out.println(Arrays.toString(arr));
        List<String> list=Arrays.asList(arr);
        for(String str:list){
            System.out.println(str);
        }
        arr[1]="six";//对数组元素改变，集合的元素也会改变
        System.out.println(Arrays.toString(arr));
        System.out.println(list);
        //对集合元素改变，数组的元素也会改变
        list.set(2,"seven");
        System.out.println(Arrays.toString(arr));
        System.out.println(list);


    }
}
